package cn.itcast.bos.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.base.Standard;
/**
 * JpaRepository<Standard, Integer>
 * 第一个参数是实体类
 * 第二个参数是实体类主键的数据类型
 * @author Administrator
 *
 */
public interface StandardRepository extends JpaRepository<Standard, Integer> {

	List<Standard> findByName(String name);

	List<Standard> findByNameLike(String name);

	@Query(value="from Standard where name = ?",nativeQuery=false)
	List<Standard> queryName(String name);

	@Query
	List<Standard> queryName2(String name);

	@Query(value="update Standard set minLength = ?2 where id = ?1")
	@Modifying
	void updateMinLength(Integer id, Integer minLength);

}
